'''
Created on 2013-11-02

@author: Nich
'''
class ComponentManager():
    
    def __init__(self):
        self.componentList = {}
    
    
    def registerComponent(self, component_name, component):
        if not component_name in self.componentList:
            self.componentList[component_name] = component
        else:
            raise ValueError("Component '{0}' already exists in the component manager".format(component_name))
    
    def getComponent(self, oid, component_name):
        if component_name in self.component_list:
            if oid in self.component_list[component_name]:
                return self.component_list[component_name][oid]
            else:
                raise AttributeError
        
        
        